package cn.jboa.dao.impl;

import cn.jboa.dao.CheckResultDao;
import cn.jboa.entity.BizCheckResult;
import cn.jboa.entity.BizClaimVoucher;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

@Repository("checkResultDao")
public class CheckResultDaoImpl extends BaseHibernateDaoSupport<BizCheckResult> implements CheckResultDao {
    @Autowired
    public CheckResultDaoImpl(@Qualifier("sessionFactory")SessionFactory sessionFactory){
        this.setSessionFactory(sessionFactory);
    }
    public int deleteByClaimVoucher(BizClaimVoucher claimVoucher) {
        String hql="delete from BizCheckResult where claimId=?";
        return this.getHibernateTemplate().bulkUpdate(hql,claimVoucher.getId());
    }
}
